<?php

namespace app\common\model;

class SystemArea extends Base
{

    protected $name = "system_area";

    /**
     *
     * @param string $city_id
     * @return array
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public function getAreaByCityList(string $city_id = ''): array
    {
        return $this->field('area_id as value,area as name')
            ->where("father", $city_id)
            ->order("sort desc,id asc")
            ->select()
            ->toArray();
    }


}